#include "../bsp/ap3216c/ap3216c.h"
#include "../bsp/ap3216c/ap3216c2.h"
#include "../bsp/clk/bsp_clk.h"
#include "../bsp/int/bsp_int.h"
#include "../bsp/led/bsp_led.h"
#include <stdio.h>

/*
 * @description	: main函数
 * @param 		: 无
 * @return 		: 无
 */
int main(void) {

  int_init();      /* 初始化中断(一定要最先调用！) */
  imx6u_clkinit(); /* 初始化系统时钟 			*/
  clk_enable();    /* 使能所有的时钟 			*/
  led_init();      /* 初始化led 			*/
  unsigned short res = 0;
  AP3216_Init();

  while (1) {
    led_switch(LED0, 1);
    res = AP3216_R_ALS();
    printf("als res =%d \r\n", res);
    delay_s(1);
    led_switch(LED0, 0);
    res = AP3216_R_PS();
    printf("ps res =%d \r\n", res);
    delay_s(1);
  }

  return 0;
}
